package C7_8_IntroduceLocalExtension;

import org.junit.Test;

import java.util.Date;

/**
 * 包装类 重构后
 */
public class MfDateWrap {

    private Date _orignal;

    public MfDateWrap(String dateString){
        _orignal = new Date(dateString);
    }

    public MfDateWrap(Date arg){
        _orignal = arg;
    }

    public int getYear(){
        return _orignal.getYear();
    }

    public int getMonth(){
        return _orignal.getMonth();
    }

    public int getDate(){
        return _orignal.getDate();
    }

    Date nextDay() {
        return new Date(getYear(), getMonth(), getDate() + 1);
    }

    public static void main(String[] args) {
        Date date = new Date();
        MfDateWrap mfDateWrap = new MfDateWrap(date);
        System.out.println(mfDateWrap.nextDay());
    }
}
